﻿using System.Web.Http;
using System.Web.Routing;

namespace Spotted.WebApi
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            // special route for the picture upload
            routes.MapHttpRoute(
                name: "SpotPictureUpload",
                routeTemplate: "api/Spot/{id}/Picture",
                defaults: new {controller = "Spot", action = "PutPicture"}
            );

            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
}